<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'bookcomments.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <logic:notPresent name="prefilled">
     <form action="" method="post">
        <h1>Please enter your comment below:</h1><br/>
            <input type="text" name="isbn" value="<%=request.getParameter("isbn")%>" disabled>
    <h3>Comment Title:</h3><input type="text" name="title" /><br/>
    <h3>Comment:</h3><textarea name="desc" cols="50" rows="10" wrap="virtual"></textarea> <br/>
    
    <input type="submit" value="Add Comment" />
    </form>
    </logic:notPresent>
    <logic:present name="prefilled">
    <h3>Comment Title:</h3>
    <html:text name="prefilled" property="title" />
    <h3>Comment:</h3> 
    <html:textarea name="prefilled" property="description" />
    <h3>Flagged?</h3>
    
    
    
    <logic:equal name="flag" value="1">
    <html:select property="flag" value="1">
	<html:option value="1" >Yes</html:option>
	<html:option value="0">No</html:option>
	</html:select>
	</logic:equal>
	
	<logic:equal name="flag" value="0">
	<html:select property="flag" value="0">
	<html:option value="0" >No</html:option>
	<html:option value="1">Yes</html:option>
	</html:select>
	</logic:equal>


	<html:submit value="Submit"></html:submit>
    </logic:present>
    
  </body>
</html>
